home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-17 | 1.8 KB | 50 lines |
- ' ************************************* Commands used:
- ' * * Mask Copy
- ' * Amcaf Examples * Fcircle
- ' * Mask Copy V1.0 * Fellipse
- ' * Written by Chris Hodges * (Blitter Copy Limit)
- ' * * (Blitter Copy)
- ' ************************************* (=Binlog)
- '
- ' Load an iff picture and hide it from view.
- Load Iff "Data/Weazle.iff",0 : Screen Hide
- ' Now get screen dimensions and number of colours.
- WX=Screen Width : WY=Screen Height
- AC=Screen Colour
- ' Open a screen to hold the mask. Same size as the original picture but only
- ' two colours.
- Screen Open 2,WX,WY,2,0 : Screen Hide
- Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
- ' Open a screen to copy the new image onto. Again the same size, but this time
- ' with AC colours.
- Screen Open 1,WX,WY,AC,0
- Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
- ' Copy the palette of the original picture
- Get Palette 0
- ' Double buffer to avoid flickering.
- Double Buffer
- Autoback 0
- ' Now calculate the middle of the screen. Activate the mask-screen.
- Screen 2
- MX=WX/2 : MY=WY/2
- For A=1 To MX-19 Step 4
- ' Draw some gfx onto the mask screen. These are 2-coloured.
- Extension_8_05E6 MX,MY,A
- Extension_8_05F8 0,0,A/2+1,A
- Extension_8_05F8 WX-1,0,A/2+1,A
- Extension_8_05F8 0,WY-1,A/2+1,A
- Extension_8_05F8 WX-1,WY-1,A/2+1,A
- ' Now copy the original screen to the new one, using the template from
- ' Screen 2.
- Extension_8_086C 0 To 1,Logbase(0)
- ' PS: a nice replacement routine for Mask Copy. Test it, it's faster!
- ' Blitter Copy Limit 0
- ' For B=0 To Binlog(AC)-1
- ' Blitter Copy 0,B,2,0 To 1,B,%11000000
- ' Next
- ' Display the new screen.
- Screen Swap 1 : Wait Vbl
- Next
- ' Last frame: Copy the whole screen to complete the image.
- Screen Copy 0 To 1
- Screen Swap 1 : Wait Vbl